﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace SharpPlanetsModel {
  public static class Utilities {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="externalPoint"></param>
    /// <param name="localPoint"></param>
    /// <returns></returns>
    public static double GetXDistanceBetweenPoints(Position externalPoint, Position localPoint) {
      return localPoint.getXAbs() - externalPoint.getXAbs();
    }

    public static double GetDistanceBetweenPoints(Position externalPoint, Position localPoint) {
      int Xdistance = localPoint.getXAbs() - externalPoint.getXAbs();
      int Ydistance = localPoint.getYAbs() - externalPoint.getYAbs();
      return (System.Math.Sqrt(System.Math.Pow(Xdistance, 2) + System.Math.Pow(Ydistance, 2)));
    }

    public static double GetYDistanceBetweenPoints(Position externalPoint, Position localPoint) {
      return localPoint.getYAbs() - externalPoint.getYAbs();
    }

    public static double ConvertAngleToRad(float AngleInDegree) {
      return Math.PI * AngleInDegree / 180.0;
    }

  }
}
